build(ENG-12825): migrate packaging to uv + pyproject.toml#317
Draft
BartoszBlizniak wants to merge 6 commits into
Draft
build(ENG-12825): migrate packaging to uv + pyproject.toml#317BartoszBlizniak wants to merge 6 commits into
BartoszBlizniak wants to merge 6 commits into
Conversation
5 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates the CLI’s packaging and dependency management from setup.py/setup.cfg + requirements.{in,txt} to pyproject.toml with uv.lock as the lockfile source of truth, and updates CI/dev bootstrap to use uv accordingly.
Changes:
- Replaces legacy packaging/requirements files with a
pyproject.toml-based build anduvdependency groups/lockfile workflow. - Updates GitHub Actions CI (tests + lint) and local
direnvbootstrap (.envrc) to install/run viauv. - Adds prompt unstyling for Click confirm prompts in non-TTY contexts and adjusts tests for newer Click behavior / contextmanager formatting.
Reviewed changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Removed legacy setuptools packaging entrypoint in favor of pyproject.toml. |
| setup.cfg | Removed legacy wheel/pytest/coverage configuration now represented in pyproject.toml. |
| requirements.txt | Removed pip-tools compiled lockfile; uv.lock becomes the pinned source of truth. |
| requirements.in | Removed dev dependency input file; dev deps move to pyproject.toml dependency groups. |
| pyproject.toml | New packaging/build configuration, dependencies, and pytest/coverage config in one place. |
| CONTRIBUTING.md | Updates contributor setup instructions to reference uv + pyproject.toml/uv.lock. |
| cloudsmith_cli/core/tests/test_generic_detector.py | Makes environment detection test resilient by disabling AWS detector in context. |
| cloudsmith_cli/core/tests/test_detector_controls.py | Refactors multi-patch with statement into modern parenthesized form. |
| cloudsmith_cli/cli/utils.py | Adds maybe_unstyle_prompt() and routes confirmation prompts through it. |
| cloudsmith_cli/cli/tests/commands/test_tokens.py | Refactors stacked patch() calls into parenthesized with form. |
| cloudsmith_cli/cli/tests/commands/test_metadata.py | Adjusts assertion to unstyle output to avoid ANSI-split substrings. |
| cloudsmith_cli/cli/tests/commands/test_mcp.py | Refactors stacked patch() calls into parenthesized with form. |
| cloudsmith_cli/cli/tests/commands/test_check.py | Refactors stacked patch() calls into parenthesized with form. |
| AGENTS.md | Updates agent/dev guidance to reflect uv/pyproject.toml/uv.lock. |
| .github/workflows/test.yml | Switches matrix test job setup/install/run steps from pip to uv. |
| .github/workflows/lint.yml | Consolidates linting into a single uv + pre-commit job and adds concurrency control. |
| .envrc | Updates local bootstrap to uv sync --locked --group dev instead of pip/requirements files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- release.yml: replace `python setup.py sdist bdist_wheel` with `uv build` in both the build and publish-pypi jobs (setup.py was removed); add `astral-sh/setup-uv` steps (with caching disabled to satisfy zizmor's cache-poisoning audit on this tag-triggered publishing workflow); correct the pushed wheel filename from `*-py2.py3-none-any.whl` to `*-py3-none-any.whl` to match the new build output. - AGENTS.md: drop the reference to `packaging/constraints.txt`, which does not exist on this branch (it belongs to the separate binary-build work), keeping only the accurate pyproject.toml + uv.lock guidance. Declined (with evidence): - pyproject.toml license string: PEP 639 SPDX string `license = "Apache-2.0"` is valid for setuptools 82.0.1; `uv build` succeeds and emits `License-Expression: Apache-2.0` in METADATA. - Apache license classifier: PEP 639 supersedes license classifiers; adding it makes setuptools 82.0.1 raise InvalidConfigError and breaks the build. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cloudsmith-iduffy
approved these changes
Jul 7, 2026
cloudsmith-iduffy
left a comment
Contributor
There was a problem hiding this comment.
Two small questions but nothing blocking.
6 tasks
Transitive dependency via mcp. Versions >=2.12.0,<2.14.2 allow NestedSecretsSettingsSource to follow symlinks outside secrets_dir. pip-audit against the exported lock is clean and the test suite passes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The prompt-through-input() change that bypasses ANSI stripping landed in click 8.4 (_readline_prompt), not 8.2. Verified empirically: the styled prompt leaks ANSI in captured output on 8.4.0/8.4.1 but not 8.1.8-8.3.1. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Answers PR #317 review question. test.yml and lint.yml keep enable-cache: true where caching actually pays off. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
BartoszBlizniak
added a commit
that referenced
this pull request
Jul 8, 2026
Review feedback on #318: with the uv migration (#317) in the base branch, install everything from the locked binary dependency group instead of pip plus an exported constraints file: - native/alpine/glibc builds now use uv sync --locked --no-dev --no-editable --group binary --extra all and uv run --no-sync pyinstaller. --no-editable matters: the default editable install leaves cloudsmith_cli out of site-packages, so PyInstaller cannot bundle it (the frozen binary fails with ModuleNotFoundError); a non-editable install matches the previous pip behavior. - container builds install a pinned uv (UV_VERSION) with UV_PYTHON_DOWNLOADS=never so they keep building against the image's system Python (preserving the glibc 2.28 floor on almalinux 8). - drop packaging/constraints.txt, its pre-commit sync hook, the CI export/cmp gate, and the AGENTS.md reference — uv.lock is now the single source of pins. Verified locally on macOS arm64: uv sync + uv run pyinstaller from the workflow commands, then --version and packaging/smoketest.sh offline against the built dist all pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Migrate CLI packaging to
pyproject.toml+uv(with a lockeduv.lock) as a single source of truth, replacingsetup.py,setup.cfg, andrequirements.{in,txt}. CI (test.yml,lint.yml) now runs throughuv. No change to CLI behaviour.Type of Change
Additional Notes
uv buildproduces the same wheel + sdist.requirements.txtis removed;uv exportregenerates a pinned list if a consumer needs one.